package com.cjg.xiancheng;

import java.text.SimpleDateFormat;
import java.util.Date;

public class threadTime {
    public static void main(String[] args) throws InterruptedException {

        f();



        while (true){
            //打印当前系统的时间
            Date date = new Date(System.currentTimeMillis());
            Thread.sleep(1000);
            System.out.println(new SimpleDateFormat("yyyy--MM--dd HH:mm:ss").format(date));

        }
    }



    public static void f() throws InterruptedException {
        int i=10;
        while (true){
            Thread.sleep(100);
            System.out.println(i--);
            if (i==0)break;
        }

    }
}
